<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script>
			function test(a, b) {
				a += 1;
				b(a);
			}

			test(3, function(result) {
				console.log(result);
			});
		</script>
	</body>

</html>